<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>D3 基础概念</title>
    <script src="http://cdn.bootcss.com/d3/5.15.1/d3.js"></script>
</head>

<body>
    <h1>D3 基础概念</h1>
    <script>
        let div = document.createElement("div")
        div.innerHTML = "这是由js生成的内容"
        document.body.appendChild(div)

        d3.select("body")
            .append("div")
            .text("这是由d3生成的内容")


        let data = [4, 8, 15, 16, 23, 42]

        d3.select("body")
            .selectAll("p")
            .data(data)
            .enter()
            .append("p")
            .text("New paragraph!");
    </script>
</body>

</html>
